package org.zoomdev.zoom.common.caster;

import org.zoomdev.zoom.common.io.Io;

import java.io.File;
import java.io.IOException;

class File2ByteArray implements ValueCaster {
    @Override
    public Object to(Object src) {
        try {
            return Io.readBytes((File) src);
        } catch (IOException e) {
            throw new CasterException("Cannot read file " + src, e);
        }
    }
}